<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>位置追踪系统</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    <style>
        body {
            font-family: 'Arial', sans-serif;
            margin: 0;
            padding: 0;
            text-align: center;
            background-color: #e9ecef;
            color: #333;
        }
        .container {
            max-width: 1000px;
            margin: 20px auto;
            padding: 20px;
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
            position: relative;
        }
        h1 {
            color: #2c3e50;
            margin-bottom: 30px;
            font-size: 2.5em;
            font-weight: bold;
        }
        .plot-container {
            max-width: 800px;
            margin: 20px auto;
            position: relative;
            z-index: 1;
        }
        img {
            max-width: 100%;
            height: auto;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0,0,0,0.2);
            transition: transform 0.3s ease-in-out;
        }
        img:hover {
            transform: scale(1.05);
        }
        .refresh-time {
            color: #666;
            font-size: 14px;
            margin-top: 20px;
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
        }
        .footer {
            margin-top: 30px;
            font-size: 12px;
            color: #777;
        }
        .fa-sync {
            margin-left: 5px;
            color: #3498db;
            animation: spin 1s infinite linear;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>位置追踪系统 <i class="fas fa-sync"></i></h1>
        <div class="plot-container">
            <img src="{{ url_for('static', filename='location_plot.png') }}?t={{ range(1000000) | random }}" 
                 alt="位置追踪图">
        </div>
        <div class="refresh-time" id="refresh-countdown"></div>
        <div class="footer">版权所有 © 2024 位置追踪系统</div>
    </div>

    <script>
        // 刷新倒计时功能
        function updateCountdown(seconds) {
            document.getElementById('refresh-countdown').textContent = 
                `页面将在 ${seconds} 秒后刷新`;
        }

        let countdown = 2; // 设置初始倒计时为1秒
        updateCountdown(countdown);
        
        const countdownInterval = setInterval(() => {
            countdown -= 0.1; // 每100毫秒减少0.1秒
            updateCountdown(countdown.toFixed(1));
            if (countdown <= 0) {
                clearInterval(countdownInterval);
                window.location.reload(1); // 刷新页面
            }
        }, 100);
    </script>
</body>
</html>